<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="">问诊单列表</a></li>
			<li><a href="{:url('Question/create')}">添加问题及答案</a></li>
		</ul>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th>ID</th>
					<th>问题</th>
					<th colspan='4'>答案</th>
				</tr>
			</thead>
			<tbody>
				<empty name="data">
					<tr><td class="text-center" colspan="12">暂无任何数据！</td></tr>
					<else/>
					<foreach name="data" item="v">
						<tr>
							<td>{$v.q_id}</td>
							<td>{$v.q_content}</td>
								<foreach name="v.answerdata" item="vo">
									<td>{$vo.a_content}</td>
								</foreach>
							<td>
								<a href="{:url('Question/editques',['id'=>$v.q_id])}" class="btn btn-primary btn-xs">修改</a>
								<a href="{:url('Question/deleteques',['id'=>$v.q_id])}" class="btn btn-danger btn-xs js-ajax-delete">删除</a>

							</td>
						</tr>
					</foreach>
				</empty>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script src="__STATIC__/js/layer/layer.js"></script>
	<script>
		$(".info").click(function(e){
		    let id = $(e.target).attr("data-id");
		    layer.open({
				type:2,
				title:"预约信息",
				area:['600px',"80%"],
				content:"{:url('Order/read')}?id="+id
			});
		});
		$(".info2").click(function(e){
		    let id = $(e.target).attr("data-id");
		    layer.open({
				type:2,
				title:"问诊单信息",
				area:['450px',"80%"],
				content:"{:url('Order/wenzhen')}?id="+id
			});
		});

	</script>
</body>
</html>
